package com.example.assetmanagement.mapper;

import com.example.assetmanagement.domain.OperationLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface OperationLogMapper {

    List<OperationLog> selectPage(@Param("offset") int offset,
                                  @Param("limit") int limit,
                                  @Param("module") String module,
                                  @Param("operationType") String operationType,
                                  @Param("userId") Long userId);

    long count(@Param("module") String module,
               @Param("operationType") String operationType,
               @Param("userId") Long userId);

    OperationLog selectById(@Param("id") Long id);

    int insert(OperationLog log);

    int deleteById(@Param("id") Long id);

    int deleteBatch(@Param("ids") List<Long> ids);

    int clear();

    Map<String, Object> stats();

    List<Map<String, Object>> operationTypeStats();

    List<Map<String, Object>> moduleStats();
} 